﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" 
Inherits="Nivdal.FriendDetails" Theme="SkinFile" Codebehind="FriendDetails.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="FriendDetailsTitleLabel" runat="server" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:HiddenField ID="FriendIdHiddenField" runat="server" />
        <asp:HyperLink ID="FriendsSuggestionsLink" runat="server" Text="<%$ Resources:Resource, Friends_SuggestionsTitleLabelText %>"
         NavigateUrl="~/Friends.aspx" SkinID="GreenTitleHyperLink"></asp:HyperLink>
         <br /><br />

    
        <asp:ImageButton ID="StopFriendshipImageButton" runat="server" OnClick="StopFriendship" ImageUrl="~/Images/Icons/delete.png"
         ToolTip="<%$ Resources:Resource, FriendDetails_StopFriendshipButtonToolTip %>"/>
        <asp:FormView ID="FriendDetailsFormView" runat="server" DataSourceID="FriendDetailsSqlSourse" >
            <ItemTemplate>
                <asp:Image ID="UserPictureImage" runat="server" style="float:left; margin:5px;" ImageUrl='<%# Eval("Picture") %>'/>
                <asp:HyperLink ID="UserHyperlink" runat="server" SkinID="GreenTitleHyperLink" Text='<%# Eval("PublicName") %>'
                 NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>'></asp:HyperLink>
                <asp:HyperLink ID="CountryHyperlink" runat="server" ImageUrl='<%# "~/Images/Flags/" + Eval("CountryFlag") %>' 
                NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("CountryId") %>' ToolTip='<%# Eval("CountryName") %>'></asp:HyperLink>
                <br />
                <asp:Label ID="TeamNameTitleLabel" runat="server" SkinID="InfoLabel" Text="<%$ Resources:Resource, Global_TeamName %>"></asp:Label>
                <asp:HyperLink ID="TeamHyperlink" runat="server" SkinID="GreenTitleHyperLink" Text='<%# Eval("TeamName") %>'
                 NavigateUrl='<%# "~/TeamHomePage.aspx?TeamId=" + Eval("TeamId") %>'></asp:HyperLink>
                <br />
                <asp:Label ID="NumberTitleLabel" runat="server" Text='<%# "#" + Eval("CurrentLeaguePosition") + Resources.Resource.InLabelTextFollowPage %>' SkinID="GridLabel"></asp:Label> 
                <asp:HyperLink ID="LeagueLink" runat="server" Text='<%# Eval("LeagueName") %>' SkinID="GreenTitleHyperLink"
                NavigateUrl='<%# "League.aspx?LeagueId=" + Eval("LeagueId")  %>'></asp:HyperLink>
            
                <br />
                <asp:Label ID="FriendSinceTitleLabel" runat="server" SkinID="InfoLabel" Text="<%$ Resources:Resource, FriendDetails_FriendSinceTitleLabelText %>"></asp:Label>
                <asp:Label ID="FriendsSinceLabel" runat="server" Text='<%# Eval("FriendsSince") %>' SkinID="GridLabel"></asp:Label>
                <br />
                <asp:Panel ID="IsPlayingMatchPanel" runat="server" Visible='<%# !(bool)Eval("IsPlayingMatch") %>'>
            
                    <asp:Label ID="WinningSequenceTitleLabel" runat="server" Text="<%$ Resources:Resource, FriendDetails_WinningSequenceTitleLabelText %>"
                     SkinID="InfoLabel"></asp:Label>
                    <asp:Label ID="WinningSequenceLabel" runat="server" Text='<%# Eval("WinningSequence") %>' SkinID="GridLabel"></asp:Label>
                    <br />
                    <asp:Label ID="WinningSequenceRecordTitleLabel" runat="server" Text="<%$ Resources:Resource, FriendDetails_WinningSequenceRecordTitleLabelText %>"
                     SkinID="InfoLabel"></asp:Label>
                    <asp:Label ID="WinningSequenceRecordLabel" runat="server" Text='<%# Eval("RecordWinningSequence") %>' SkinID="GridLabel"></asp:Label>
                    <br />
                    <asp:Label ID="WinningSequenceRecordThisSeasonTitleLabel" runat="server" SkinID="InfoLabel"
                     Text="<%$ Resources:Resource, FriendDetails_WinningSequenceRecordThisSeasonTitleLabelText %>"></asp:Label>
                    <asp:Label ID="WinningSequenceRecordThisSeasonLabel" runat="server" Text='<%# Eval("RecordWinningSequenceThisSeason") %>'
                     SkinID="GridLabel"></asp:Label>            
                    <br />
                    <asp:Label ID="UnbeatenSequenceTitleLabel" runat="server" SkinID="InfoLabel"
                     Text="<%$ Resources:Resource, FriendDetails_UnbeatenSequenceTitleLabelText %>"></asp:Label>
                    <asp:Label ID="UnbeatenSequenceLabel" runat="server" Text='<%# Eval("UnbeatenSequence") %>' SkinID="GridLabel"></asp:Label>
                    <br />
                    <asp:Label ID="UnbeatenSequenceRecordTitleLabel" runat="server" SkinID="InfoLabel"
                    Text="<%$ Resources:Resource, FriendDetails_UnbeatenSequenceRecordTitleLabelText %>"></asp:Label>
                    <asp:Label ID="UnbeatenSequenceRecordLabel" runat="server" Text='<%# Eval("RecordUnbeatenSequence") %>'
                     SkinID="GridLabel"></asp:Label>
                     <br />
                    <asp:Label ID="UnbeatenSequenceRecordThisSeasonTitleLabel" runat="server" SkinID="InfoLabel"
                     Text="<%$ Resources:Resource, FriendDetails_UnbeatenSequenceRecordThisSeasonTitleLabelText %>"></asp:Label>
                    <asp:Label ID="UnbeatenSequenceRecordThisSeasonLabel" runat="server" Text='<%# Eval("RecordUnbeatenSequenceThisSeason") %>'
                     SkinID="GridLabel"></asp:Label>
                     <br />
                    <asp:Label ID="RecordGoalsInOneMatchTitleLabel" runat="server" SkinID="InfoLabel"
                     Text="<%$ Resources:Resource, FriendDetails_RecordGoalsInOneMatchTitleLabelText %>"></asp:Label> 
                    <asp:Label ID="RecordGoalsInOneMatchLabel" runat="server" SkinID="GridLabel" 
                     Text='<%# Eval("RecordGoalsScoredInOneGame") %>'></asp:Label>
                    &nbsp;
                    <asp:HyperLink ID="RecordGoalsScoredInOneGameHyperlink" runat="server" SkinID="GreenTitleHyperLink"
                     NavigateUrl='<%# "~/MatchPage.aspx?MatchId=" + Eval("RecordGoalsScoredInOneGameMatchId") %>'
                     Text='<%# Eval("RecordGoalsScoredInOneGameMatchTitle") %>'></asp:HyperLink>
                     <br />
                    <asp:Label ID="RecordGoalsInOneMatchBothTeamsTitleLabel" runat="server" SkinID="InfoLabel"
                    Text="<%$ Resources:Resource, FriendDetails_RecordGoalsInOneMatchBothTeamsTitleLabelText %>"></asp:Label>
                    <asp:Label ID="RecordGoalsInOneMatchBothTeamsLabel" runat="server" SkinID="GridLabel"
                     Text='<%# Eval("RecordGoalsInOneMatchBothTeams") %>'></asp:Label>
                    <asp:HyperLink ID="RecordGoalsScoredInOneGameBothTeamsHyperlink" runat="server" SkinID="GreenTitleHyperLink"
                     Text='<%# Eval("RecordGoalsBothTeamsMatchTitle") %>' 
                     NavigateUrl='<%# "~/MatchPage.aspx?MatchId=" + Eval("RecordGoalsBothTeamsMatchId") %>'></asp:HyperLink>
                 </asp:Panel>
             
            </ItemTemplate>
        </asp:FormView>
        <asp:SqlDataSource ID="FriendDetailsSqlSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_FriendshipGetFriendDetails" SelectCommandType="StoredProcedure"></asp:SqlDataSource> 
        <br />   
        <asp:Label ID="MatchesTitleLabel" runat="server" Text="<%$ Resources:Resource, Follow_MatchesTitleLabelText %>" 
        SkinID="InfoLabel"></asp:Label>
        <br />
        <asp:GridView ID="MatchesGridview" runat="server" DataSourceID="MatchesSqlSourse" AllowPaging="false" AutoGenerateColumns="false"
         SkinID="Professional">
            <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Image ID="MatchTypeImage" runat="server" ImageUrl='<%# GetNivdalData.GetNivdalData.GetIconByMatchType(Eval("Type")) %>' 
                                    ToolTip='<%# GetNivdalData.GetNivdalData.GetToolTipByMatchType(Eval("Type")) %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:Label ID="MatchDateTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Charisma %>"></asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' SkinID="GridLabel"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:Label ID="MatchTitleHeaderLabel" runat="server" Text="<%$ Resources:Resource, Global_Match %>"></asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>                            
                                    <asp:HyperLink ID="MatchHyperlink" runat="server" NavigateUrl='<%# "MatchPage.aspx?MatchId=" + Eval("MatchId")  %>'
                                     Text='<%# Eval("MatchTitle") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Label ID="ScoreLabel" runat="server" Text='<%# Eval("Score") %>' SkinID="GridLabel"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
           
        </asp:GridView>
        <br />
        <%--<table><tr>
            <td style="width:50%;">
                <asp:Label ID="WarningsInjuriesTitleLabel" runat="server" Text="<%$ Resources:Resource, Follow_WarningsInjuriesTitleLabelText %>"
                 SkinID="InfoLabel"></asp:Label>   
                </br>
                <asp:GridView ID="InjuredWarnedPlayersGridView" runat="server" DataSourceID="InjuredWarnedPlayersDataSourse" AutoGenerateColumns="false"
                 SkinID="Professional">
                    <EmptyDataTemplate>
                        <asp:Label ID="NoProblemsLabel" runat="server" Text="<%$ Resources:Resource, Follow_NoProblemsLabelText %>" SkinID="GridLabel"></asp:Label>                
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="20%">
                            <ItemTemplate>
                                <asp:Image ID="InjuredImage" runat="server" ImageUrl="~/Images/Icons/players_sick.jpg"
                                 ToolTip='<%# Eval("InjuryString") %>' Visible='<%# Eval("InjuryVisible") %>' />
                                <asp:Image ID="FirstYellowCard" runat="server" ImageUrl="~/Images/Icons/players_yellow.jpg"
                                 ToolTip="<%$ Resources:Resource, Follow_FirstYellowCardToolTip %>" 
                                 Visible='<%# WarningCardVisible((decimal)Eval("Warnings"), 1) %>' />
                                 <asp:Image ID="SecondYellowCard" runat="server" ImageUrl="~/Images/Icons/players_yellow.jpg"
                                 ToolTip="<%$ Resources:Resource, Follow_SecondYellowCardToolTip %>" 
                                 Visible='<%# WarningCardVisible((decimal)Eval("Warnings"), 2) %>' />
                                <asp:Image ID="RedCard" runat="server" ImageUrl="~/Images/Icons/players_red.jpg"
                                 ToolTip="<%$ Resources:Resource, Follow_RedCardToolTip %>"
                                 Visible='<%# WarningCardVisible((decimal)Eval("Warnings"), 3) %>' />
                            </ItemTemplate>
                        
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HyperLink ID="PlayerHyperlink" runat="server" SkinID="BlackHyperLinkSkin"
                                 NavigateUrl='<%# "~/Player.aspx?Id=" + Eval("PlayerId") %>' Text='<%# Eval("PlayerName") %>'></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>

                </asp:GridView> 
            </td>
            <td style="width:50%;">
                
            </td>
        </tr></table>--%>
        <br />
        <asp:Label ID="LatersTransfersLabel" runat="server" Text="<%$ Resources:Resource, Follow_LatersTransfersLabelText %>"
         SkinID="InfoLabel"></asp:Label>
        <asp:GridView ID="GridView1" runat="server" Width="100%" DataSourceID="TransfersSqlDataSourse" AutoGenerateColumns="false"
         SkinID="Professional">
            <EmptyDataTemplate>
                <asp:Label ID="NoTransfersLastMonthLabel" runat="server" SkinId="GridLabel" 
                 Text="<%$ Resources:Resource, Follow_NoTransfersLastMonthLabelText %>"></asp:Label>
            </EmptyDataTemplate>
            <Columns>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Date %>" >
                    <ItemTemplate>
                        <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>                    
                <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Player %>" >
                    <ItemTemplate>
                        <asp:HyperLink ID="PlayerHyperlink" runat="server" SkinID="BlackHyperLinkSkin"
                         Text='<%# Eval("PlayerName") %>' NavigateUrl='<%# "~/Player.aspx?Id=" + Eval("PlayerId") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_From %>">                        
                    <ItemTemplate>
                        <asp:Label ID="YouthPlayerLabel" runat="server" Text="<%$ Resources:Resource, Follow_YouthPlayerText %>"
                         SkinID="GridLabel" Visible='<%# (decimal)Eval("SellerId") == 0 %>'></asp:Label>
                        <asp:HyperLink ID="SellerHyperlink" runat="server" Visible='<%# (decimal)Eval("SellerId") != 0 %>'
                         Text='<%# Eval("SellerName") %>' SkinID="BlackHyperLinkSkin" 
                         NavigateUrl='<%# "~/TeamHomePage.aspx?TeamId=" + Eval("SellerId") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, Follow_TransferToHeaderTextText %>">
                    <ItemTemplate>
                        <asp:Label ID="RetiredLabel" runat="server" Text="<%$ Resources:Resource, Follow_RetiredLabeltText %>"
                         SkinID="GridLabel" Visible='<%# (decimal)Eval("BuyerId") == 0 %>'></asp:Label>
                        <asp:HyperLink ID="BuyerHyperlink" runat="server" SkinID="BlackHyperLinkSkin" 
                         NavigateUrl='<%# "~/TeamHomePage.aspx?TeamId=" + Eval("BuyerId") %>'
                         Text='<%# Eval("BuyerName") %>' Visible='<%# (decimal)Eval("BuyerId") != 0 %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, Follow_TransferSumHeaderText %>">
                    <ItemTemplate>
                        <asp:Label ID="SumLabel" runat="server" Text='<%# Eval("TransferSum") %>' SkinID="GridLabel"></asp:Label>
                        <asp:Image ID="AtuksImage" runat="server" ImageUrl="~/Images/Icons/atuk.png"
                        ToolTip="<%$ Resources:Resource, Atuks %>" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView> 
        <asp:SqlDataSource ID="TransfersSqlDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="Nivdal_GetLatestTransfersForFollow" SelectCommandType="StoredProcedure" ></asp:SqlDataSource>
       <%-- <asp:SqlDataSource ID="InjuredWarnedPlayersDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="Nivdal_GetCardedAndInjuredPlayersForTeam" SelectCommandType="StoredProcedure" ></asp:SqlDataSource>--%>
    
        <asp:SqlDataSource ID="MatchesSqlSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetTop3MatchesForTeam" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
        <%--
            2/ Latest transfers grid
            3/ 
         
        --%>
    </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" Runat="Server">
    <asp:Label ID="PageNameLabel" runat="server" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>

